<?php
if (CommentTag::count()) {
?>
    <h3 id="comments">Reader's Comments</h3>

<?php
foreach(CommentTag::comment_list() as $comment) {
?>
    <ol class="commentlist">
    		<li class="comment even thread-even depth-1" id="comment-3">
	        <img alt='' src='http://www.gravatar.com/avatar/<?php echo md5($comment->email); ?>?s=32&amp;r=G' class='avatar'/>			<strong class="commentmetadata"><?php echo $comment->username; ?></strong> | <small class="commentmetadata"><a href="#comment-<?php echo $comment->id; ?>" title=""><?php echo date('d M Y H:i a', $comment->date); ?></a> </small>
						<em>Your comment is awaiting moderation.</em>
			
			<p><?php echo $comment->content; ?></p>

<!--            <small class="replycomment">Reply</small> -->
       </li>
    </ol>
<?php
}
?>
	<div style="clear:both"></div>
	<div class="commentsnavigation">
		<div class="alignleft"></div>
		<div class="alignright"></div>
	</div>
   	<div style="clear:both"></div>
<?php
}
?>





<div id="respond">

<h3>Leave a Comment</h3>

<form action="<?php echo CommentTag::form_url(); ?>" method="post" id="commentform">
<?php
if (UserTag::is_login()) {
    echo 'Logged in as ', html::admin_anchor('profile', UserTag::username());
} else {
?>
<p><input type="text" name="username" id="author" value="<?php echo CommentTag::values('username'); ?>" size="22" tabindex="1" aria-required='true' />
<label for="author"><small>Name (required)</small></label> <?php echo CommentTag::errors('username_error'); ?></p>

<p><input type="text" name="email" id="email" value="<?php echo CommentTag::values('email'); ?>" size="22" tabindex="2" aria-required='true' />
<label for="email"><small>Mail (will not be published) (required)</small></label><?php echo CommentTag::errors('email_error'); ?></p>

<p><input type="text" name="url" id="url" value="<?php echo CommentTag::values('url'); ?>" size="22" tabindex="3" />
<label for="url"><small>Website</small></label><?php echo CommentTag::errors('url_error'); ?></p>
<?php
}
?>
<p><textarea name="content" id="comment" cols="65" rows="10" tabindex="4"><?php echo CommentTag::values('content'); ?></textarea><?php echo CommentTag::errors('content_error'); ?></p>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
</p>
<input type="hidden" value="" name="parent_id" />
</form>
</div>
